package com.suray.basic.wcs.utils;

public enum ModuleType {
    DEFAULT("基础模块"),
    WCS_SYSTEM("WCS系统"),
    RGV("RGV"),
    RES_20_RGV("Res2.0 RGV"),
    RGV_60("RGV6.0"),
    RGV_ROLLER("滚筒车"),
    RGV_SON_MOTHER("子母车"),
    RGV_SON("子车"),
    RGV_FORK("叉车"),
    ASSIGN_RGV_RES20("Res2.0 Rgv 分车"),
    CHARGE_RES20("RES2.0 Rgv 充电"),
    SYSTEM_CONFIGURATION("系统配置"),
    CONVERY_PLC("PLC输送线"),
    DATA_STORE_MYSQL("MySql数据存储"),
    DIAGNOSE("诊断"),
    DODGE_RES20("RES2.0 Rgv 避让"),
    FAULT_HANDING("故障处理"),
    HTTP("HTTP通讯"),
    LIFTER_PLC("PLC提升机"),
    LIFTER_RGV("自卸式提升机"),
    FORK_LIFTER("货叉式提升机"),
    MAP_RES20("RES2.0 Rgv 地图"),
    MAP_SEER("Seer 地图"),
    RGV_RES20("RES2.0 Rgv"),
    RGV_RES60("Rgv 6.0"),
    ROUTE_PLANING_RES20("RES2.0 Rgv 路径规划"),
    RUN_INFO("运行信息"),
    SOCKET("Socket通讯"),
    TASK("任务"),
    WCS("WCS业务"),
    WEB_SOCKET("Web Socket通讯"),
    WMS_SURAY("Suray Wms交互"),
    SYSTEM_MONITOR("系统监控"),
    SHOW("汉诺威展会"),
    RUN_FOR_GCODE("跑码"),
    PLC("Plc"),
    ;

    String des;
    ModuleType(String des) {
        this.des = des;
    }

    public String getDes() {
        return des;
    }

    public int getValue() {
        int value = 1;
        for (ModuleType module : ModuleType.values()) {
            if (this.equals(module)) {
                return value;
            }
            value++;
        }

        throw new RuntimeException("错误的ModuleType：" + this);
    }

    public static ModuleType parseModuleType(int value) {
        int v = 1;
        for (ModuleType module : ModuleType.values()) {
            if (v == value) {
                return module;
            }
            v++;
        }

        return null;
    }

    @Override
    public String toString() {
        return des;
    }
}
